<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script>

        $(function () {

            let arr = []
            let num = 0
            $("input[type=button]").click(function () {
                let str = $("#arr").val();
                let ss = str.split(",");
                for (let s of ss) {
                    if (parseInt(s)%2===0){
                        arr[num++] = s
                    }
                }


                $("#result").html("<input type=\"text\" value=\"["+arr.toString()+"]\">")
            })


        })

    </script>
</head>
<body>
<h2>找出数组中的偶数，返回新数组</h2>
字符串数组格式：（2,3,1,3,6）：<input type="text" id="arr"/> <br/>
<input type="button" value="开始查找"/>
<div id="result">

</div>
</body>
</html>

